﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Dynamic.Data.Model;
using System.ComponentModel;

namespace Dynamic.Testing.Model
{
    public class MappingBaseTest
    {
        public static void Go()
        {
            MappingSample ms = new MappingSample();
            ms.PropertyChanged += new PropertyChangedEventHandler(Test);
            if (ms.DisplayValues.ContainsKey("F1"))
            {
                Console.WriteLine("ddd");
            }
            Console.WriteLine("hi");
            ms.F1 = Guid.NewGuid();
            Console.WriteLine("ok");
            if (ms.DisplayValues.ContainsKey("F1"))
            {
                Console.WriteLine("ddd");
            }
        }

        public static void Test(object sender, PropertyChangedEventArgs e)
        {
            Console.WriteLine("hello");
            Console.WriteLine(e.PropertyName);
        }
    }

    public class MappingSample : MappingBase
    {
        public static int i = 0;

        public string Getss()
        {
            return i++.ToString();
        }

        private Guid f1;
        public Guid F1
        {
            get
            {

                return f1;
            }
            set
            {
                base.SendPropertyChanging("F1");
                this.f1 = value;
                base.SendPropertyChanged("F1");
            }
        }
    }
}
